<html>
  <head>
	<script type="text/javascript" src="lib/globals.js"></script>
	<script type="text/javascript" src="lib/events.js"></script>
	<script type="text/javascript" src="lib/screen.js"></script>
	<script type="text/javascript" src="lib/eventHandlerObject.js"></script>
	<script type="text/javascript" src="lib/widget.js"></script>
	<script type="text/javascript" src="lib/gui/textbox.js"></script>
	<script type="text/javascript" src="lib/testobj.js"></script>
	<script type="text/javascript" src="lib/gui/scrollbar.js"></script>



	<script type="text/javascript">
	
		function deneme()
		{
			globalScreen.init("base",8,"rgb(0,55,0)");
			//var tobj = new testobj(); //create an object to be shown in screen
			//sc.addItem(tobj); //register object to the screen
			
			globalEventObject.init();
			//add some event triggers to object
			//tobj.addEventListener("onmousedown",new Function('event,caller', 'dragItem = caller;')); //this makes our object draggable 

			// now create a text box
			var mytext = new textbox("mytextbox");
			mytext.size.width = 90;
			mytext.size.height = 25;
			mytext.position.x = 30;
			mytext.position.y = 30;
			
			//create and register a dragable object
			var mydrag = new testobj("mydrag");
			mydrag.setPosition(111,111);
			mydrag.setSize(25,34);
			mydrag.addEventListener("onmousedown",new Function("event,caller","dragItem = caller;caller.dragMin = [0,0];caller.dragMax = [800-caller.size.width, 600-caller.size.height]")); //we set drag properties here

			
			//create a scrollbar
			var myscroll = new scrollbar("myscroll");
			myscroll.position.x = 630;
			myscroll.position.y = 400;
			myscroll.size.width = 40;
			myscroll.size.height = 150;
			myscroll.init();

			//register my text with the screen object to make it drawable
			globalScreen.addItem(mytext);
			globalScreen.addItem(mydrag);
			globalScreen.addItem(myscroll);
			//alert(myscroll.sectionPlaces.join(" ")+"\n"+mytext.sectionPlaces.join(" ")+"\n"+mydrag.sectionPlaces.join(" "))
			globalScreen.start();
			
		}
		
		
	</script>
  </head>
  <body>
    <input id="yok" type="button" value="test" onclick="deneme();" />
	<canvas id="base" width="800" height="600" tabindex="1" style="position:absolute;top:44;left:44">
	</canvas>
	
	<div id="info" style="position:absolute;left:20;top:650;background-color:gray;height:200;width:400">event info:</div>
	
	
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.getElementById("base").oncontextmenu=new Function("return false")

// --> 
</script>
  </body>
</html>
